package qc.module.cms.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.cms.dto.article.ArticleLogDto;
import qc.module.cms.entity.ArticleLog;

import java.util.List;

/**
 * ArticleLogMapper
 *
 * @author QuCheng Tech
 * @since 2023/5/26
 */
@Mapper
public interface ArticleLogMapper {
    ArticleLogMapper MAPPER = Mappers.getMapper(ArticleLogMapper.class);

    @Mapping(target = "op", source = "op.index")
    @Mapping(target = "tm", source = "tm", dateFormat = "yyyy-MM-dd HH:mm:ss")
    ArticleLogDto toDto(ArticleLog en);

    List<ArticleLogDto> toDtoList(List<ArticleLog> list);
}
